/**
 * 工程名称:oms
 * 文件名称:IStockPushService.java
 * 所属包:cn.rkylin.oms.system.stockpush.service
 * 创建时间:2017年9月4日下午2:43:44
 * Copyright (c) 2017 瑞金麟(大连)信息技术有限公司 All Rights Reserved.
 * 创建人:zhanghao
 */

package cn.rkylin.oms.system.stockpush.service;

import java.util.List;

import cn.rkylin.oms.system.stockpush.domain.StockFmla;
import cn.rkylin.oms.system.stockpush.domain.StockFmlaRatioStorage;
import cn.rkylin.oms.system.stockpush.vo.ProjectStockFmlaVO;
import cn.rkylin.oms.system.stockpush.vo.StockFmlaRatioSkuVO;
import cn.rkylin.oms.system.stockpush.vo.StockFmlaRatioStorageVO;

/**
 * 类名:IStockPushService <br/>
 * 作用: 库存推送设置的服务类接口. <br/>
 * 创建原因:	 库存推送设置的服务类接口. <br/>
 * 创建时间:     2017年9月4日 下午2:43:44 <br/>
 * @author   zhanghao
 * @version  v1.0
 * @since    JDK 1.6
 * @see 	 
 */
public interface IStockPushService {
    /**
     * getUserProjectWithStockFmla:获取用户可配置的项目列表. <br/>
     * 当前登录用户可用.<br/>
     *
     * @author zhanghao
     * @return
     * @since JDK 1.6
     */
    List<ProjectStockFmlaVO> getUserProjectWithStockFmla() throws Exception;
    
    /**
     * getStockFmlaRatioStorageList:获取仓库推送比例. <br/>
     * 根据根据查询项过滤仓库推送比例的数据.<br/>
     * 由于在设置推送比例前，需要根据工程获取已有的推送比例，故引入此方法<br/>
     *
     * @author zhanghao
     * @param stockFmlaRatioStorageVO
     * @return
     * @throws Exception
     * @since JDK 1.6
     */
    List<StockFmlaRatioStorage> getStockFmlaRatioStorageList(StockFmlaRatioStorageVO stockFmlaRatioStorageVO) throws Exception;
    
    /**
     * getStockFmlaRatioSkuList:获取店铺推送比例. <br/>
     * 根据根据查询项过滤商品推送比例的数据，如项目ID，SkuId等.<br/>
     *
     * @author zhanghao
     * @param stockFmlaRatioSkuVO
     * @return
     * @throws Exception
     * @since JDK 1.6
     */
    List<StockFmlaRatioSkuVO> getStockFmlaRatioSkuList(StockFmlaRatioSkuVO stockFmlaRatioSkuVO) throws Exception;
    
    /**
     * saveStorageRatio:存储仓库推送比例列表. <br/>
     *
     * @author zhanghao
     * @param storageRatioList
     * @return
     * @throws Exception
     * @since JDK 1.6
     */
    int saveStorageRatio(List<StockFmlaRatioStorageVO> storageRatioList) throws Exception;
    
    /**
     * selectStockFmla:根据项目ID查询库存公式列表. <br/>
     * 通常情况下，一个项目ID只对应一个库存公式
     * @author zhanghao
     * @param stockFmlaVO
     * @return 库存计算公式对象
     * @throws Exception
     * @since JDK 1.6
     */
    StockFmla getStockFmlaByProjectId(String projectId) throws Exception;
    /**
     * saveStockFmlaByProjectId:保存库存计算公式. <br/>
     *
     * @author zhanghao
     * @param stockFmla
     * @return 公式对象
     * @throws Exception
     * @since JDK 1.6
     */
    StockFmla saveStockFmla(StockFmla stockFmlaVO) throws Exception;
    
    /**
     * getDistinctSetSkuList:获取已设置库存推送比例的商品列表.. <br/>
     *
     * @author zhanghao
     * @param page
     * @param length
     * @param stockFmlaRatioSkuVO
     * @return
     * @throws Exception
     * @since JDK 1.6
     */
    List<StockFmlaRatioSkuVO> getDistinctSetSkuList(int page,int length,StockFmlaRatioSkuVO stockFmlaRatioSkuVO) throws Exception;

    /**
     * saveSkuRatio:存储商品推送比例列表. <br/>
     *
     * @author zhanghao
     * @param skuRatioList 商品库存推送比例列表
     * @return
     * @throws Exception 
     * @since JDK 1.6
     */
    int saveSkuRatio(List<StockFmlaRatioSkuVO> skuRatioList) throws Exception;
    
    /**
     * deleteSkuRatio:根据条件删除库存推送比例. <br/>
     *
     * @author zhanghao
     * @param stockFmlaRatioSkuVO
     * @return
     * @throws Exception
     * @since JDK 1.6
     */
    int deleteSkuRatio(StockFmlaRatioSkuVO stockFmlaRatioSkuVO) throws Exception;
    /**
     * caculateStock:计算推送数
     * 输入：项目ID，商店ID，商品ID和库存ID计算. <br/>
     *
     * @author zhanghao
     * @param projectId 项目ID
     * @param shopId    商品ID
     * @param skuId     商品ID
     * @param storageId     仓库ID
     * @return 返回计算结果的整数字符串
     * @throws Exception
     * @since JDK 1.6
     */
    String caculateStock(String projectId, String shopId, String skuId, String storageId,StockFmla fmla) throws Exception;

    /**
     * deleteProjectSets:根据项目ID删除项目的所有信息. <br/>
     *
     * @author zhanghao
     * @param projectId
     * @throws Exception 
     * @since JDK 1.6
     */
    void deleteProjectSets(String projectId) throws Exception;
}

